-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix using CoilImage with an implicit size #61
Conversation
Currently CoilImage only works when you specific a size Modifier, since it waits for onPositioned to be called, and only starts a Coil request when it has a non-zero size. If no Modifier is provided, the CoilImage will have a zero size and we never execute a Coil request. Fixed by moving back to WithConstraints to move the request size logic to be based on the incming constraints, rather than the final size, which is probably more correct anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks for addressing this!
Can you create a new constant called UNSPECIFIED
which can be Int.MAX_VALUE
behind the scenes? It makes for more readable code IMO. I would suggest null
, but I see that all these things are not nullable
so an UNSPECIFIED
reads fine in this case.
Sounds good, done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update looks good, just saw one typo in the Javadoc. Up to you if you want to address. Minor.
Currently
CoilImage
only works when you specific a size Modifier, since it waits foronPositioned
to be called, and only starts a Coil request when it has a non-zero size. If no Modifier is provided, theCoilImage
will have a zero size and we never execute a Coil request.Fixed by moving back to
WithConstraints
to move the request size logic to be based on the incoming constraints, rather than the final size, which is probably more correct anyway.